<!DOCTYPE html>
<html lang="zh-cmn-Hans-CN">
<head>
    <title><%= htmlWebpackPlugin.options.title %></title>
    <%= require('../partials/head.ejs')() %>
</head>

<body>
<!-- S:header -->
<header class="header asset-zcs">
    <!-- <%= htmlWebpackPlugin.options.title %> -->
    <span class="ico-line"></span>
    <!-- <h1 class="hd-tit asset-tp"><%= htmlWebpackPlugin.options.title %></h1> -->
</header>
<!-- E:header -->

<!-- S:container -->
<div class="container">
    <!-- asset -->
    <div class="asset light-bg">
        <!-- my asset -->
        <div class="my-asset red-box zi-can">
            <!-- 1 -->
            <div class="ma-wrap">
                <h3 class="ma-tit">最新收益（元）</h3>
                <p class="ma-num"><strong class="total-amount" data-filed="newestProfit">--</strong></p>
            </div>
            <!-- 2 -->
            <div class="ma-wrap hide">
                <h3 class="ma-tit">持仓收益（元）</h3>
                <p class="ma-num"><strong class="total-amount" data-filed="positionProfit">--</strong></p>
            </div>
            <!-- 3 -->
            <div class="ma-wrap hide">
                <h3 class="ma-tit">总资产（元）</h3>
                <p class="ma-num"><strong class="total-amount" data-filed="totalAsset">--</strong></p>
            </div>
            <p class="ma-ft clearfix">
                <span class="date fl" data-filed="navDate">--</span>
                <a href="trade-records.html" class="view-more fr">查看交易纪录</a>
            </p>
            <p class="ma-links">
                <a class="left" href="javascript:;">最新收益</a>
                <a href="javascript:;">持仓收益</a>
                <a class="right" href="javascript:;">总资产</a>
            </p>
        </div>
        <!-- asset-bar -->
        <div class="asset-bar box">
            <a href="asset-structure.html" class="grey arrow-right">
                <span class="ico-rec"></span><b>我的资产结构</b>
            </a>
        </div>
    </div>
    <!-- products recommend -->
    <div class="bg-f">
        <ul class="">
            <script class="view" id="view" type="text/html">
                {{if !userFundList||userFundList.length==0}}
                <li class="empty">
                    暂无数据
                </li>
                {{/if}}
                {{each userFundList as o}}
                <li>
                    <a href="">
                        <div class="border-zc">
                            <!-- <span class="org-triangle" data-tag="智能筛选"></span> -->
                            <h3 class="pro-name">

                                <span class="ioc-img">智能筛选</span><span>{{o.fundName}} {{o.fundCode}}</span> <span
                                        class="date grey times">{{navDate}}</span>

                            </h3>
                        </div>
                        <div class="pro-data">
                            <!-- 1 -->
                            <div class="new-profit">
                                <strong class="return-percent">{{o.riseAndFall}}</strong>
                                <h4 class="grey">最新收益（元）</h4>
                            </div>
                            <!-- 2 -->
                            <div class="new-profit">
                                <strong class="red return-percent">{{o.riseAndFall}}</strong>
                                <h4 class="grey">最新涨跌幅</h4>
                            </div>
                            <!-- 3 -->
                            <div class="gains">
                                <strong class="ft27">{{o.fundPositionProfit}}</strong>
                                <h4 class="grey">持仓收益</h4>
                            </div>
                            <!-- 4 -->
                            <div class="value">
                                <strong class="ft27">{{o.fundPositionValue}}</strong>
                                <h4 class="grey">持仓市值（元）</h4>
                            </div>

                        </div>
                    </a>
                </li>
                {{/each}}

            </script>
            <!-- <script>
                     $(function(){
                         $('#J_AjaxTest').bind('click', function(event) {
                             /* Act on the event */
                             $.ajax({
                                 url: 'service/asset/myasset/info/0.json',
                                 type: 'GET',
                                 dataType: 'json',
                                 data: {act: 'getRoom'},
                                 success : callback -->
                                                        <!-- });
                        //  function callback (obj){
                        //      if (obj.flag ==0) {
                        //          var list = '<ul></ul>';
                        //          $('#J_AjaxContent').html(list);
                        //          $.each(obj.content, function(index, val) {
                        //               /* iterate through array or object */
                        //               var listItem = '<li>书名：'+val.title+'。人气：'+val.live.count+'</li>';
                        //               $('#J_AjaxContent ul').append(listItem);
                        //          });
                        //      }
                             //console.log(obj.flag);
                         }
                 })
                 </script> -->

        </ul>

    </div>


</div>
<!-- E:container -->
 <script>
     $(function () {
         $ajax({
             url:'/service/asset/myasset/info/0',
             success: function (data) {
                console.log(data);
                // $('[data-filed]').each(function () {
                //    $(this).text(data.result[$(this).data('filed')]);
                //  });
                //  $('#view').parent()[0].innerHTML += $.template('view', data.result);
            }
         })
     });
 </script>


<!-- <script type="text/javascript">
  $(function(){
    $.ajax({
        url:'data/service/userAsset/getUserAsset/0',
        type:'GET',
        dataType:'json',
        success:function(data){

        }

    })


  })
</script> -->
</body>
</html>
